<?php


/**
 * Class Involved_UserModel
 * 体验金投资记录表
 */

class Involved_ExperRecordModel extends BaseModel{

    protected $table = 'exper_record';

    public function ExperRecord($user_id)
    {
        return DB::table($this->table)
            ->join('user','user.user_id','=','exper_record.user_id')
            ->paginate(10);
    }

    /**
     * 体验标投标记录查询
     * @param $page
     * @return mixed
     */
    public function ExperBidRecord($page)
    {
        $limit = ($page-1)*10;
        return DB::table($this->table)
            ->select('exper_money','exper_time','user_name','mobile')
            ->join('user','user.user_id','=','exper_record.user_id')
            ->skip($limit)->take(10)
            ->get();
    }

    public function ExperBidRecordOne($user_id,$first,$end)
    {
        return DB::table($this->table)
            ->where(['user_id'=>$user_id])
            ->whereBetween('exper_time',array($first,$end))
            ->get();
    }
}
